﻿<Window x:Class="Bricks.MiuiThemeMaker.MiuiThemeMaker.ElementWin"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ElementWin" Height="400" Width="600" WindowStartupLocation="CenterOwner">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="True" Name="dgElement">
            <DataGrid.Columns>
                <DataGridTextColumn Width="*" Header="ID" Binding="{Binding Path=ID}" />
                <DataGridTextColumn Width="*" Header="名称" Binding="{Binding Path=Name}" />
                <!--<DataGridTextColumn Width="*" Header="父ID" Binding="{Binding Path=ParentID}" />-->
                <DataGridTemplateColumn Width="*" Header="父ID">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox SelectedValue="{Binding Path=ParentID,UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="ID" DisplayMemberPath="Name" ItemsSource="{Binding Path=ParentElementList}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Width="*" Header="类型" Binding="{Binding Path=Type}" />
                <DataGridTextColumn Width="*" Header="难度系数" Binding="{Binding Path=Difficult}" />
                <DataGridTextColumn Width="*" Header="宽" Binding="{Binding Path=Width}" />
                <DataGridTextColumn Width="*" Header="高" Binding="{Binding Path=Height}" />
                <DataGridTextColumn Width="*" Header="左" Binding="{Binding Path=Left}" />
                <DataGridTextColumn Width="*" Header="上" Binding="{Binding Path=Top}" />
                <DataGridTextColumn Width="*" Header="层" Binding="{Binding Path=Layer}" />
                <DataGridTextColumn Width="*" Header="标记" Binding="{Binding Path=Flag}" />
                <DataGridTextColumn Width="*" Header="备注" Binding="{Binding Path=Remark}" />
                <DataGridTextColumn Width="*" Header="排序" Binding="{Binding Path=OrderNo}" />
                <DataGridTextColumn Width="*" Header="主题ID" Binding="{Binding Path=ThemeID}" />
                <!--<DataGridTextColumn Width="*" Header="主题版本" Binding="{Binding Path=ThemeVersion}" />-->
                <DataGridTemplateColumn Width="*" Header="主题版本">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox Text="{Binding Path=ThemeVersion,UpdateSourceTrigger=PropertyChanged}">
                                <ComboBoxItem Content="V4" />
                                <ComboBoxItem Content="V2" />
                            </ComboBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button x:Name="btnAdd" Content="新增" Click="btnAdd_Click"/>
            <Button x:Name="btnDelete" Content="删除" Click="btnDelete_Click"/>
            <Button x:Name="btnSave" Content="保存" Click="btnSave_Click"/>
            <Button x:Name="btnClose" Content="关闭" Click="btnClose_Click"/>
        </StackPanel>

    </Grid>
</Window>
